doc: mention prototype check in deepStrictEqual()#5367
doc: mention prototype check in deepStrictEqual()#5367cjihrig wants to merge 1 commit intonodejs:masterfrom
Conversation
The docs for assert.deepStrictEqual() do not currently mention that prototypes are compared for objects. This commit adds that information to the documentation. Fixes: nodejs#5365
|
R=@nodejs/documentation |
|
LGTM |
|
I'm not sure I would understand what "object prototypes are included in the comparison" means - it might imply they need to have the same |
|
What about this? |
|
That might still imply that their prototypes are checked and are expected to be equal (is that the case?) - what about:
|
|
It's actually a strict comparison of the prototypes. https://github.com/nodejs/node/blob/master/lib/assert.js#L199 |
|
@cjihrig Oh, in that case my bad - LGTM |
| values are compared using the strict equality operator ( `===` ). | ||
| Generally identical to [`assert.deepEqual()`][] with the exceptions that | ||
| primitive values are compared using the strict equality operator ( `===` ), and | ||
| object prototypes are included in the comparison. |
There was a problem hiding this comment.
object prototypes are included in the comparison.
seems a little vague to me.
There was a problem hiding this comment.
See proposed change in the main thread.
There was a problem hiding this comment.
it would have been better if we could somehow say that prototypes should be the same. But yeah the proposed change also is okay.
|
LGTM |
The docs for assert.deepStrictEqual() do not currently mention that prototypes are compared for objects. This commit adds that information to the documentation. Fixes: #5365 PR-URL: #5367 Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
|
Thanks for the reviews. Landed in 10f55b0. |
The docs for assert.deepStrictEqual() do not currently mention that prototypes are compared for objects. This commit adds that information to the documentation. Fixes: #5365 PR-URL: #5367 Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
The docs for assert.deepStrictEqual() do not currently mention that prototypes are compared for objects. This commit adds that information to the documentation. Fixes: #5365 PR-URL: #5367 Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
The docs for assert.deepStrictEqual() do not currently mention that prototypes are compared for objects. This commit adds that information to the documentation. Fixes: #5365 PR-URL: #5367 Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
The docs for assert.deepStrictEqual() do not currently mention that prototypes are compared for objects. This commit adds that information to the documentation. Fixes: #5365 PR-URL: #5367 Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
The docs for assert.deepStrictEqual() do not currently mention that prototypes are compared for objects. This commit adds that information to the documentation. Fixes: #5365 PR-URL: #5367 Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
The docs for
assert.deepStrictEqual()do not currently mention that prototypes are compared for objects. This commit adds that information to the documentation.Fixes: #5365